package com.example.springsecurity.controller;


import com.example.springsecurity.hadoop.hive.HbaseClient;
import com.example.springsecurity.service.JsoupService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.io.IOException;
import java.text.ParseException;

/**
 * @author 梁贤卓
 * 定时任务
 */
@Component
public class ScheduleTask{

    @Resource
    JsoupService jsoupService;

    @Scheduled(cron="0 50 3 ? * *")
    private void settlement() throws IOException, ParseException {
        jsoupService.catchData();
        HbaseClient.clear();
    }

}
